package com.xxxx.web.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xxxx.web.dto.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 仓库表表
 */
@Data
@TableName("`Warehouse`")
public class Warehouse extends BaseEntity {


    /**
     * 环境条件
     */
    @JsonProperty("EnvironmentalConditions")
    @TableField(value = "EnvironmentalConditions", updateStrategy = FieldStrategy.IGNORED)
    private String EnvironmentalConditions;

    /**
     * 联系人
     */
    @JsonProperty("ContactPerson")
    @TableField(value = "ContactPerson", updateStrategy = FieldStrategy.IGNORED)
    private String ContactPerson;

    /**
     * 联系电话
     */
    @JsonProperty("Phone")
    @TableField(value = "Phone", updateStrategy = FieldStrategy.IGNORED)
    private String Phone;

    /**
     * 国家
     */
    @JsonProperty("Country")
    @TableField(value = "Country", updateStrategy = FieldStrategy.IGNORED)
    private String Country;

    /**
     * 地址
     */
    @JsonProperty("Address")
    @TableField(value = "Address", updateStrategy = FieldStrategy.IGNORED)
    private String Address;

    /**
     * 仓库名称
     */
    @JsonProperty("Name")
    @TableField(value = "Name", updateStrategy = FieldStrategy.IGNORED)
    private String Name;

    /**
     * 仓库类型
     */
    @JsonProperty("Type")
    @TableField(value = "Type", updateStrategy = FieldStrategy.IGNORED)
    private String Type;

    /**
     * 城市
     */
    @JsonProperty("City")
    @TableField(value = "City", updateStrategy = FieldStrategy.IGNORED)
    private String City;

    /**
     * 面积
     */
    @JsonProperty("Area")
    @TableField(value = "Area", updateStrategy = FieldStrategy.IGNORED)
    private Double Area;

    /**
     * 把仓库表实体转换成仓库表传输模型
     */
    public WarehouseDto MapToDto() throws InvocationTargetException, IllegalAccessException {
        WarehouseDto WarehouseDto = new WarehouseDto();

        BeanUtils.copyProperties(WarehouseDto, this);

        return WarehouseDto;
    }

}
